<template>
  <view class="container">
    <u-list>
      <u-list-item>
        <u-cell title="昵称" :value="user.nickname">
          <u-icon slot="icon" size="40" name="account-fill"></u-icon>
        </u-cell>
      </u-list-item>
      <u-list-item>
        <u-cell title="手机号码" :value="user.mobile">
          <u-icon slot="icon" size="40" name="phone"></u-icon>
        </u-cell>
      </u-list-item>
      <u-list-item>
        <u-cell title="注册日期" :value="user.createTime">
          <u-icon slot="icon" size="40" name="calendar"></u-icon>
        </u-cell>
      </u-list-item>
      <u-list-item>
        <u-cell title="最近登录日期" :value="user.user.lastLoginTime">
          <u-icon slot="icon" size="40" name="lock-open"></u-icon>
        </u-cell>
      </u-list-item>
    </u-list>
  </view>
</template>

<script>
  import { getInfo } from "@/api/login"

  export default {
    data() {
      return {
        user: {}
      }
    },
    onLoad() {
      this.getUser()
    },
    methods: {
      getUser() {
        getInfo().then(response => {
          this.user = response.data
          console.log(this.user)
        })
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>
